* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4a90e2;
  --primary-dark: #357abf;
  --secondary-color: #f8f9fa;
  --text-color: #333;
  --text-light: #666;
  --text-lighter: #999;
  --bg-color: #f5f5f5;
  --border-color: #eee;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  background-color: var(--primary-color);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  background-color: var(--text-lighter);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.chat-header {
  padding: 18px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.chat-header h2 {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: #f9f9f9;
  background-image: 
    radial-gradient(circle at 25px 25px, rgba(0,0,0,0.02) 2%, transparent 2%),
    radial-gradient(circle at 75px 75px, rgba(0,0,0,0.02) 2%, transparent 2%);
  background-size: 100px 100px;
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 0;
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
  word-break: break-word;
  transition: var(--transition);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-time {
  font-size: 12px;
  color: var(--text-lighter);
  margin-top: 5px;
  text-align: right;
}

.message-ai {
  align-self: flex-start;
  background-color: white;
  border-bottom-left-radius: 5px;
  border: 1px solid #eee;
}

.message-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-bottom-right-radius: 5px;
}

.message-user .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid var(--border-color);
  background-color: white;
  position: relative;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.chat-input input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 16px;
  margin-right: 10px;
  transition: var(--transition);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.chat-input button {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  min-width: 80px;
}

.chat-input button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chat-input button:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .chat-input {
    padding: 10px;
  }
  
  .chat-input input {
    padding: 10px;
  }
  
  .chat-input button {
    padding: 10px 15px;
  }
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
} 